package view;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class LabelCartaTeste extends JLabel {
	
	private static final long serialVersionUID = 1L;	
	
	public LabelCartaTeste () {
		this.setSize(296, 400);
		this.setIcon(this.getImagem());
	}
	
	private ImageIcon getImagem() {
		try {
			BufferedImage imagem = ImageIO.read(new File(
					this.getClass().getResource("../images/cartas/A/captainamerica.jpg").getPath()));
			Image imagemMenor = imagem.getScaledInstance(296, 400, Image.SCALE_AREA_AVERAGING+Image.SCALE_SMOOTH);
			return new ImageIcon(imagemMenor);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}		
		return null;
	}
}
